package com.sockety2;

import static java.lang.System.out;

import java.util.Set;

public class BehStd extends Behavior {

	@Override
	public Object todo(String line) {
		if(line.equals("-shd")){
			shd();
		}
		else if(line.equals("-showThr")){
			return showThr();
		}
		return null;
	}
	
	public void shd(){
		
	}
	
	public String showThr(){
		String info = "";
        String console = "";
        Set<Thread> set =  Thread.getAllStackTraces().keySet();
        for(Thread t : set){
            info += (t.getName() + "\n\r");
            console += (t.getName() + "\n");
        }
        out.print(console);
        return info;
	}

}
